package com.tiancheng.trade.settlement.model.settlement;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tiancheng.trade.settlement.model.base.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.List;


/**
 * 对账函
 *
 * @Desc
 * @Time 2024-02-19 18:14
 * @GeneratedByCodeFactory
 */
@Getter
@Setter
@TableName("statement_of_account")
public class StatementAccount extends BaseEntity implements java.io.Serializable {

    /**
     * 对账函编码
     */
    private String statementCode;

    /**
     * 商户编码/商户ID
     */
    private String merchantCode;

    /**
     * 商户名称
     */
    private String merchantName;

    /**
     * 城市名称
     */
    private String cityName;

    /**
     * 业务场景
     */
    private String orderSource;

    /**
     * 销售数量合计
     */
    private Integer sellQtySum;

    /**
     * 结算单价合计
     */
    private Integer settlePriceSum;

    /**
     * 结算金额合计
     */
    private Integer settleAmountSum;


    /**
     * 统计开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:s")
    private LocalDateTime countStartDate;

    /**
     * 统计开始时间
     */
    @TableField(exist = false)
    private String countStartDateStr;

    /*
     * 统计结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:s")
    private LocalDateTime countEndDate;

    /*
     * 统计结束时间
     */
    @TableField(exist = false)
    private String countEndDateStr;

    @TableField(exist = false)
    private List<StatementProduct> productList;

    @JsonProperty("is_delete")
    private Integer isDelete;

    public Integer getSellQtySum() {
        if (null == sellQtySum) {
            sellQtySum = 0;
        }
        return sellQtySum;
    }

    public Integer getSettlePriceSum() {
        if (null == settlePriceSum) {
            settlePriceSum = 0;
        }
        return settlePriceSum;
    }

    public Integer getSettleAmountSum() {
        if (null == settleAmountSum) {
            settleAmountSum = 0;
        }
        return settleAmountSum;
    }

}